import request from '@/utils/request'

// 查询行程库内容列表
export function listContent(query) {
  return request({
    url: '/travel/itinerary/content/list',
    method: 'get',
    params: query
  })
}

// 查询行程库内容详细
export function getContent(itineraryContentId) {
  return request({
    url: '/travel/itinerary/content/' + itineraryContentId,
    method: 'get'
  })
}

// 新增行程库内容
export function addContent(data) {
  return request({
    url: '/travel/itinerary/content',
    method: 'post',
    data: data
  })
}

// 修改行程库内容
export function updateContent(data) {
  return request({
    url: '/travel/itinerary/content',
    method: 'put',
    data: data
  })
}

// 删除行程库内容
export function delContent(itineraryContentId) {
  return request({
    url: '/travel/itinerary/content/${itineraryContentId}' ,
    method: 'delete'
  })
}

// 批量新增行程库内容
export function batchAddContent(data) {
  return request({
    url: '/travel/itinerary/content/batch',
    method: 'post',
    data: data
  })
}

// 批量更新行程库内容
export function batchUpdateContent(data) {
  return request({
    url: '/travel/itinerary/content/batch',
    method: 'put',
    data: data
  })
}

// 调整行程库内容顺序
export function adjustContentOrder(data) {
  return request({
    url: '/travel/itinerary/content/order',
    method: 'put',
    data: data
  })
}

// 获取行程库内容树结构
export function getContentTree(itineraryId) {
  return request({
    url: '/travel/itinerary/content/tree/' + itineraryId,
    method: 'get'
  })
}
